package com.fqgj.sentry.controller.mc.request;

import com.fqgj.common.utils.CollectionUtils;
import com.fqgj.sentry.common.exception.BizException;
import com.fqgj.sentry.common.exception.enums.ErrorCodeEnums;
import com.fqgj.sentry.common.request.ParamsObject;

import java.util.List;

/**
 * Created by ykpbean kangping.ying@yuntu-inc.com
 *
 * @description
 * @create 2017-07-18 下午2:46
 */


public class AddGroupManagerRequest extends ParamsObject {
    private Long userId;
    private List<String> applicationId;
    private List<String> roleId;

    @Override
    public void validate() {
        if (CollectionUtils.isNotEmpty(applicationId)
                && CollectionUtils.isNotEmpty(roleId)) {

        } else{
           throw new BizException(ErrorCodeEnums.param_valid_error,"权限组必须要有应用和角色");
        }
    }


    public Long getUserId() {
        return userId;
    }

    public AddGroupManagerRequest setUserId(Long userId) {
        this.userId = userId;
        return this;
    }

    public List<String> getApplicationId() {
        return applicationId;
    }

    public AddGroupManagerRequest setApplicationId(List<String> applicationId) {
        this.applicationId = applicationId;
        return this;
    }

    public List<String> getRoleId() {
        return roleId;
    }

    public AddGroupManagerRequest setRoleId(List<String> roleId) {
        this.roleId = roleId;
        return this;
    }
}
